package com.scalar.chiptrack.finance.reports;

import com.scalar.chiptrack.utils.StringUtils;

import java.util.ArrayList;

/**
 * User: prasad
 * Date: Jun 11, 2007
 * Time: 4:19:10 PM
 */

public class DirectMargin implements Cloneable
{
    private int costCodeId;
    private int customerId;
    private int salesOrderId;
    private int processstepId;
    private int hide;

    private String customerName;
    private String partNumber;
    private String salesOrderNo;
    private String costCode;

    private int units;
    private float unitsCost;
    private float unitsPrice;
    private float actualCost;
    private float directMargin;
    private float directMarginPerctage;

    private ArrayList directMarginList;
    private int count;
    private int level;
    
    public int getCostCodeId() {
        return costCodeId;
    }

    public void setCostCodeId(int costCodeId) {
        this.costCodeId = costCodeId;
    }

    public int getCustomerId() {
        return customerId;
    }

    public void setCustomerId(int customerId) {
        this.customerId = customerId;
    }

    public int getSalesOrderId() {
        return salesOrderId;
    }

    public void setSalesOrderId(int salesOrderId) {
        this.salesOrderId = salesOrderId;
    }

    public int getProcessstepId() {
        return processstepId;
    }

    public void setProcessstepId(int processstepId) {
        this.processstepId = processstepId;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getPartNumber() {
        return partNumber;
    }

    public void setPartNumber(String partNumber) {
        this.partNumber = partNumber;
    }

    public String getSalesOrderNo() {
        return salesOrderNo;
    }

    public void setSalesOrderNo(String salesOrderNo) {
        this.salesOrderNo = salesOrderNo;
    }

    public String getCostCode() {
        return costCode;
    }

    public void setCostCode(String costCode) {
        this.costCode = costCode;
    }


    public int getUnits() {
        return units;
    }

    public void setUnits(int units) {
        this.units = units;
    }

    public float getUnitsCost() {
        return unitsCost;
    }

    public void setUnitsCost(float unitsCost) {
        this.unitsCost = unitsCost;
    }

    public float getUnitsPrice() {
        return unitsPrice;
    }

    public void setUnitsPrice(float unitsPrice) {
        this.unitsPrice = unitsPrice;
    }

    public float getDirectMargin() {
        return directMargin;
    }

    public void setDirectMargin(float directMargin) {
        this.directMargin = directMargin;
    }

    public float getDirectMarginPerctage() {
        return directMarginPerctage;
    }

    public void setDirectMarginPerctage(float directMarginPerctage) {
        this.directMarginPerctage = directMarginPerctage;
    }


    public ArrayList getDirectMarginList() {
        return directMarginList;
    }

    public void setDirectMarginList(ArrayList directMarginList) {
        this.directMarginList = directMarginList;
    }


    public float getActualCost() {
        return actualCost;
    }

    public void setActualCost(float actualCost) {
        this.actualCost = actualCost;
    }


    public int getHide() {
        return hide;
    }

    public void setHide(int hide) {
        this.hide = hide;
    }

    public String getUnitsCostFormatted()
    {
        return StringUtils.formatAmount(unitsCost);
    }
    public String getUnitsPriceFormatted()
    {
        //return StringUtils.formatAmount(unitsPrice);
        return StringUtils.formatUnits ( (int)unitsPrice );
    }
    public String getActualCostFormatted()
    {
        return StringUtils.formatAmount(actualCost);
    }
    public String getDirectMarginFormatted()
    {
        return StringUtils.formatAmount(directMargin);
    }
    public String getDirectMarginPerctageFormatted()
    {
        //return StringUtils.formatAmount(directMarginPerctage);
        return StringUtils.formatUnits ( (int)directMarginPerctage );
    }
    public String getUnitsFormatted()
    {
        return StringUtils.formatUnits(units);
    }
    public String toString()
	{
		StringBuffer buf = new StringBuffer();
		buf.append (" customerId : ").append ( customerId );
		buf.append (" customerName: ").append ( customerName );
		buf.append (" processstepId: ").append ( processstepId );
		buf.append (" partNumber: ").append (partNumber);
		buf.append (" salesOrderId: ").append (salesOrderId);
		buf.append (" salesOrderNo: ").append (salesOrderNo);
		buf.append (" costCodeId: ").append (costCodeId);
		buf.append (" costCode: ").append (costCode);
		buf.append (" units: ").append (units);
		buf.append (" unitsCost: ").append(unitsCost);
		buf.append (" unitsPrice ").append(unitsPrice);
		buf.append (" actualCost ").append(actualCost);
		buf.append (" directMargin: ").append( directMargin );
		buf.append (" hide: ").append( hide );
        buf.append (" directMarginPerctage: ").append( directMarginPerctage ).append (" ]\n");

		return buf.toString();
	}

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public Object clone() throws CloneNotSupportedException
    {
        return super.clone();
    }

    public int getLevel()
    {
        return level;
    }

    public void setLevel(int level)
    {
        this.level = level;
    }
}
